<template>
  <div>
    <el-dialog title="商品位置" :visible.sync="visible">
      <el-form>
        <el-form-item label="店铺位置">
           <el-input v-model="message[0]" readonly></el-input>
        </el-form-item>
        <el-form-item label="店铺名称">
          <el-input v-model="message[1]" readonly></el-input>
        </el-form-item>
        <el-form-item label="展示柜">
          <el-input v-model="message[2]" readonly></el-input>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data () {
    return {
      visible: false,
      message: [],
      loading: ''
    }
  },
  methods: {
    init (cabinetId) {
      this.loading = this.$loading({ text: '加载中...' })
      this.$http.get('/goods/message/' + cabinetId).then(data => {
        this.loading.close()
        if (data.code === 0) {
          this.visible = true
          this.message = data.message.split('-')
        } else {
          this.$alert(data.msg, {
            type: 'error'
          })
        }
      })
    }
  }
}
</script>

<style scoped>
.type-tag{
  margin: 5px;
}
</style>
